(function() {

this.pasta = this.pasta || {};
this.pasta.util = this.pasta.util || {};

this.pasta.util.MapList = Class.extend(
{
	init : function() 
	{
		this.keyList = new Array();
		this.valueList = new Array();
	},
	
	clear : function() 
	{
		this.keyList = new Array();
		this.valueList = new Array();
	},
	
	set : function(key, value) 
	{
		var idx = this.keyList.indexOf(key);
		
		if (idx >= 0)
			this.valueList[idx] = value;
		else
		{
			this.keyList.push(key);
			this.valueList.push(value);
		}
	},
	
	get : function(key)
	{
		var result = null;
		var idx = this.keyList.indexOf(key);
		
		if (idx >= 0)
			result = this.valueList[idx];
		
		return result;
	},
	
	getByIndex : function(index)
	{
		if (index < this.valueList.length)
			return this.valueList[index];
		else
			return null;
	},
	
	del : function(key)
	{
		var idx = this.keyList.indexOf(key);
		
		if (idx >= 0)
		{
			this.keyList.splice(idx, 1);
			this.valueList.splice(idx, 1);
		}
	},
	
	delByObject : function(value)
	{
		var idx = this.valueList.indexOf(value);
		
		if (idx >= 0)
		{
			this.keyList.splice(idx, 1);
			this.valueList.splice(idx, 1);
		}
	},
	
	delByIndex : function(index)
	{
		this.keyList.splice(index, 1);
		this.valueList.splice(index, 1);
	},
	
	isExist : function(value)
	{
		var idx = this.valueList.indexOf(value);
		
		return (idx >= 0);
	},
	
	getLength : function()
	{
		return this.keyList.length;
	},
	
	getKeyArray : function()
	{
		return this.keyList;
	},
	
	getValueArray : function()
	{
		return this.valueList;
	}
});

})();